package data

import (
	"fmt"

	"github.com/treelab/updatecolumn/models"
)

type RollupColumn struct {
	Cells            []models.Cell
	ReferenceColumns []models.Column
	DependentColumns []models.Column
}

type RollupCellQueryResult struct {
	RollupColumns []RollupColumn
}

//GetRollupCellQuery for Query
func GetRollupCellQueryString(pageSize int, offset int) string {
	return fmt.Sprintf(`
	{
		rollupColumns(func:eq(columnType, "ROLLUP"), first:%d, offset:%d) {
			cells: has_cell {
				uid
				rowId
			}
			referenceColumns: has_record_reference_column {
				uid
			}
			dependentColumns: has_dependent_column {
				uid
			}
		}
	}
`, pageSize, offset)
}
